//
//  YNSessionOpenfireManager.h
//  Messenger
//
//  Created by yineng on 2019/8/20.
//  Copyright © 2019 YN-APP-iOS. All rights reserved.
//

#import <Foundation/Foundation.h>
//视频会议收到消息通知
#define kNotifacationLiveReceiveChatMessage @"kNotifacationLiveReceiveChatMessage"
//视频会议发送消息结果回执通知
#define kNotificationLiveMessageReceipt @"kNotificationLiveMessageReceipt"
//用户上下线通知
#define YNNotificationCloudOpenfirOnline @"YNNotificationCloudOpenfirOnline"
//收到message消息通知
#define YNNotificationCloudOpenfirReciveMessage @"YNNotificationCloudOpenfirReciveMessage"
//收到房间内人员变动的通知
#define YNNotificationCloudOpenfirMemberChange @"YNNotificationCloudOpenfirMemberChange"

#define speakObjectUserId @"userId"
#define speakObjectUserName @"userName"
#define speakObjectGender @"gender"
#define speakObjectHeadUrl @"headUri"
static NSString * _sessionIMPassword = @"123456";

NS_ASSUME_NONNULL_BEGIN
@class YNMessage;
@interface YNSessionOpenfireManager : NSObject

@property(nonatomic,copy) NSString*roomId;
//登录失败需要去注册的回调
@property(nonatomic,copy)void (^needRegisterBlock)();
//注册成功的外部回调
@property(nonatomic,copy)void (^registerSuccessBlock)();
//反正就是进入房间失败了，终止进入
@property(nonatomic,copy)void (^joinRoomFailBlock)(NSString*errorMessage);
//进入房间成功
@property(nonatomic,copy)void (^joinRoomSuccessBlock)(NSArray<NSString*>*inRoomUserIds);

#pragma mark 初始化
+(instancetype)shareSessionOpenfireManager;

-(void)initXMPPWithServer:(NSString*)server companyCode:(NSString*)code imId:(NSString*)imId userName:(NSString*)userName;
#pragma mark __配置消息接收和发送
-(void)setMessageSendAndGet;

#pragma mark __销毁连接等所有资源
- (void)removeDelegate;
- (void)teardownStream;

#pragma mark 业务层面的逻辑调用
///netConnect:当前网络状态是否可用-外部传入
-(void)sendMessageWith:(NSString*)body toUserId:(NSString*)toUserId message:(YNMessage*)message netConnect:(BOOL)netConnect;
-(void)sendMessageChangeSubjectSpeakIds:(NSArray<NSDictionary*>*)speaks;
@end

NS_ASSUME_NONNULL_END
